home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 12 / Mac Magazin and MacEasy Magazine CD - Issue 12.iso / Diskette Mac MAGAZIN / QuickEditor 3.6 (FAT) / Documentation / How to write plug-ins / Examples / Transition / ClockWipe.c < prev    next >
Text File  |  1995-04-17  |  2KB  |  59 lines

  1. /********************                        ***********************/
  2. //
  3. //    ClockWipe Plug-in Source Code
  4. //
  5. //    Version 1.0        Mathias TSCHOPP
  6. //
  7. //
  8. //    Mathias TSCHOPP
  9. //    13 Troupe
  10. //    CH-1253 Vandoeuvres
  11. //    GENEVA / SWITZERLAND
  12. //    
  13. //    FAX:                (+41 22) 348 33 28
  14. //    Internet:     mtschopp@perokcity.net.ch (only short mails, no binaries!)
  15. //                            mtz@medsun.unige.ch
  16. //
  17. /********************                        ***********************/
  18.  
  19. #include "QDOffscreen.h"
  20.  
  21. // This ProcInfo descriptor is only for PPC Plug-ins
  22.  
  23. ProcInfoType __procinfo = kCStackBased|\
  24.                     RESULT_SIZE( SIZE_CODE( sizeof(Boolean) ))|\
  25.                     STACK_ROUTINE_PARAMETER( 1, SIZE_CODE( sizeof( short)))|\
  26.                     STACK_ROUTINE_PARAMETER( 2, SIZE_CODE( sizeof( GWorldPtr)))|\
  27.                     STACK_ROUTINE_PARAMETER( 3, SIZE_CODE( sizeof( GWorldPtr)))|\
  28.                     STACK_ROUTINE_PARAMETER( 4, SIZE_CODE( sizeof( short)))|\
  29.                     STACK_ROUTINE_PARAMETER( 5, SIZE_CODE( sizeof( short)))|\
  30.                     STACK_ROUTINE_PARAMETER( 6, SIZE_CODE( sizeof( Rect*)));
  31.  
  32. Boolean main (short i,GWorldPtr GMonde1,GWorldPtr GMonde2,short nbOfFrames,short version,Rect *MoviEBox)// Rotation sur Z et Translation sur Z
  33. {
  34.     Rect Etal;
  35.     Rect theC;
  36.     GWorldPtr GMondeMask=nil;
  37.     OSErr err;
  38.     RGBColor blackRGB = { 0, 0, 0 };
  39.     
  40.     SetRect(&Etal,0,0,MoviEBox->right,MoviEBox->bottom);
  41.     SetRect(&theC,-100,-100,MoviEBox->right+100,MoviEBox->bottom+100);
  42.     err = NewGWorld(&GMondeMask,32, &Etal, nil, nil, 0);
  43.     if (!GMondeMask) return 1;
  44.     SetGWorld(GMondeMask,nil);    
  45.     LockPixels (GMondeMask->portPixMap);
  46.     EraseRect(&Etal);
  47.     RGBForeColor(&blackRGB);
  48.     if (version==0) PaintArc(&theC,0,(i+1)*(float)(360/nbOfFrames));    // version==0 do ClockWise Wipe
  49.     if (version==1) PaintArc(&theC,0,-(i+1)*(float)(360/nbOfFrames));    // version==1 do CCW Wipe
  50.     SetGWorld(GMonde1,nil);    
  51.     CopyMask((BitMap *) (*(GMonde2->portPixMap)),(BitMap *) (*(GMondeMask->portPixMap)),
  52.     (BitMap *) (*(GMonde1->portPixMap)),&Etal,&Etal,&Etal);
  53.     SetGWorld(GMonde2,nil);    
  54.     CopyBits((BitMap *) (*(GMonde1->portPixMap)),(BitMap *) (*(GMonde2->portPixMap)),
  55.                         &Etal,&Etal,srcCopy,nil);
  56.     UnlockPixels(GMondeMask->portPixMap);
  57.     DisposeGWorld(GMondeMask);
  58.     return 0;
  59. }